const fs = require('fs')

const filePath = './temp.txt'
const encoding = 'utf8'

fs.readFile(filePath, encoding, (err, data) => {
  if (err) {
    console.log('读失败', err)
  } else {
    const str = data.toString()
    console.log('读成功', str)
  }
})